/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-09-07
 * Time: 9:12
 */
public class TestDemo {



//    public static void printVariable(String... args) {
//        for (String s : args) {
//            System.out.println(s);
//        }
//    }

    public static void printVariable(String... args) {
        String[] var1 = args;//可变长参数编译后,是会转变为一个可变长数组
        int len = args.length;

        for(int i = 0; i < len; ++i) {
            String s = var1[i];
            System.out.println(s);
        }
    }

    public static void printVariable(String arg1, String arg2) {
        System.out.println(arg1 + arg2);
    }

    public static void main(String[] args) {
        Integer num = 10;

        printVariable("a", "b", "c", "d");
        printVariable("a","b");
    }
}
